<!--
 * @Author: jqm123 2289662078@qq.com
 * @Date: 2025-06-10 15:02:14
 * @LastEditors: jqm123 2289662078@qq.com
 * @LastEditTime: 2025-06-25 08:28:04
 * @FilePath: /anxinxiu/src/components/goodsItem.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="goodsItem" :class="{ recommend: recommend }">
    <div class="goodsPic">
      <van-image width="100%" height="100%" :src="item.thumbnail" />
    </div>
    <div class="goods_info">
      <div class="name">{{ item.goodsName }}</div>
      <div class="bottom">
        <div class="price">¥{{ item.price }}</div>
        <div class="btn" @click.stop="buy">抢购</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "goodsItem",
  components: {},
  props: {
    recommend: {
      type: Boolean,
      default: false,
    },
    item: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {};
  },
  watch: {},
  computed: {},
  methods: {
    buy() {
      this.$emit("buy", this.item);
    },
  },
  created() {},
  mounted() {},
};
</script>
<style lang="less" scoped>
.goodsItem {
  display: flex;
  align-items: center;
  width: 100%;
  padding-bottom: 25px;
  padding-top: 25px;
  border-bottom: 3px solid #f3f3f3;
  .goodsPic {
    min-width: 170px;
    max-width: 170px;
    height: 170px;
  }
  .goods_info {
    margin-left: 30px;
    flex-grow: 1;
    .name {
      font-size: 40px;
      margin-bottom: 50px;
    }
    .bottom {
      display: flex;
      align-items: center;
      justify-content: space-between;
      .price {
        font-size: 46px;
        color: #c10500;
        font-weight: bold;
      }
      .btn {
        font-size: 40px;
        color: #fff;
        background: #e73353;
        padding: 5px 35px;
        border-radius: 10px;
      }
    }
  }
}

.recommend {
  padding-bottom: 0;
  padding-top: 0;
  border-bottom: unset;
}
</style>